﻿
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace Conquest
{
    /// <summary>
    /// Description of Map.
    /// </summary>
    public partial class StateMap : UserControl
    {
        private bool _Usable;
        
        public StateMap()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
        }
        
        public Panel StatesGroups
        {
            get 
            {
                return mapView1.GroupBox; 
            }
            
        }
        
        public bool Usable
        {
            get { return _Usable; }
            set
            {
                _Usable = value;
                if (_Usable)
                {
                    StatesGroups.ForeColor = Color.Blue;
                    StatesGroups.Enabled = true;
                }
                else
                {
                    StatesGroups.ForeColor = Color.Black;
                    StatesGroups.Enabled = false;
                }
            }
        }
        
        public List<NamedCityState> CityStates
        {
            get 
            {
                List<NamedCityState> result = new List<NamedCityState>();
                foreach (Control c in StatesGroups.Controls) 
                {
                    if (c is NamedCityState)
                    {
                        NamedCityState city = c as NamedCityState;
                        result.Add(city);
                    }
                }
                return result;
            }
        }
    }
    
    
}
